<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改数据仓库')" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-dw-edit" th:object="${etlDrawDw}">
            <input name="idDrawDw" th:field="*{idDrawDw}" type="hidden">
            <div class="form-group">
                <label class="col-sm-3 control-label">名称：</label>
                <div class="col-sm-8">
                    <input name="na" th:field="*{na}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">DW表：</label>
                <div class="col-sm-8">
                    <input name="cdTb" th:field="*{cdTb}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">所属系统：</label>
                <div class="col-sm-8">
                    <input name="sdSys" th:field="*{sdSys}" class="form-control" type="text" disabled>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">日期字段：</label>
                <div class="col-sm-8">
                   <!-- <input name="fldDt" th:field="*{fldDt}" class="form-control" type="text">-->
                    <select name="fldDt" class="form-control m-b" th:with="type=${@etlDrawBaseService.findDateFld(etlDrawDw.idDrawBase)}">
                        <option th:each="item : ${type}" th:text="${item}" th:value="${item}" th:selected="*{fldDt} eq ${item} "></option>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">ods目标表：</label>
                <div class="col-sm-8">
                    <input name="cdTbTarOds" th:field="*{cdTbTarOds}" class="form-control" type="text" disabled>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">启用标志：</label>
                <div class="col-sm-8">
                    <input type="checkbox" name="fgAct" id="fgAct" th:checked="*{fgAct == 1 ? true : false}">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">备注：</label>
                <div class="col-sm-8">
                    <input name="des" th:field="*{des}" class="form-control" type="text">
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var prefix = ctx + "etl/dw";
        $("#form-dw-edit").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {

                var value = $("#fgAct").val();
                if(value=="on") {
                    $("#fgAct").val(1)
                } else {
                    $("#fgAct").val(0);
                }
                $.operate.save(prefix + "/edit", $('#form-dw-edit').serialize());
            }
        }
    </script>
</body>
</html>